<?php
namespace App\Listener\User;

use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Event\Annotation\Listener;

use App\Repository\UserLogRepository;

/**
 * @Listener 
 */
class LogoutListener implements ListenerInterface
{
    public function listen(): array
    {
        return [
            \App\Event\User\LockEvent::class,
        ];
    }
    
    // 强制用户退出
    public function process($event)
    {
        $event->user->model()->tokenFlush();
    }
}